import React from 'react'
import "../Seckill/Seckill.css"
import { Link } from "react-router-dom"
import { Carousel } from "antd-mobile"

function Seckill(props) {
    let { list } = props;
    return (
        <div className="seckill">
            <h3 className="super-kill">超级秒杀</h3>
            {
                list.length > 0 &&
                <Carousel
                    autoplay={true}
                    infinite
                >
                    {list.map(item => (
                        <Link
                            key={item.id}
                            to={"/detail/"+item.id}
                            className="seckill-item"
                        >
                            <img src={item.img} alt="" />
                            <div>
                                <h4 className="qun">{item.goodsname}</h4>
                                <p className="lon">￥{item.price} <del>￥{item.market_price}</del></p>
                            </div>
                        </Link>
                    ))}
                </Carousel>
            }

        </div>
    )
}

export default React.memo(Seckill)
